#include <REGX52.H>
#include "Delay.h"
#include "MatrixLED.h"

unsigned char code Animation[]={
	0x00,0x0C,0x1C,0x21,0xDE,0xE0,0x3F,0x10,
	0x00,0x06,0x16,0x21,0xDE,0xE0,0x3F,0x10,
	0x00,0x03,0x13,0x21,0xDE,0xE0,0x3F,0x10,
	0x0C,0x0C,0x10,0x21,0xDE,0xE0,0x3F,0x10,
	0x00,0x0C,0x1C,0x21,0xDE,0xE0,0x3F,0x10,
}; //加code这些数据会放在flash里面，不然在RAM里。flash内存较大
//但是后面数组无法更改

void main()
{
	unsigned char i,Offset=0,Count=0;  //Offset偏移量,即数组第几列 Count控制变换速度
	MatrixLED_Init();
	while(1)
	{
		for (i=0; i<8; i++)
		{
			MatrixLED_ShowColumn(i,Animation[i+Offset]);
		}
		Count++;
		if (Count>15)
		{
			Count=0;
			Offset+=8;
			if(Offset>32) //防止数组溢出
			{
				Offset=0;
			}
				
		}
	}
}